import { request } from '@/utils/request';
import { RequestEnum } from '@/enums/httpEnum';

export const eventActivityApi = {
  eventActivityList: '/eventActivity/list',
  eventActivityDetail: '/eventActivity/detail',
  eventActivityAdd: '/eventActivity/add',
  eventActivityUpdate: '/eventActivity/update',
  eventActivityDelete: '/eventActivity/delete',
  activityEnabled: '/eventActivity/enabled',
} as const;

export const createEventActivity = (data: API.CreateEventActivityParams) => {
  return request({
    url: eventActivityApi.eventActivityAdd,
    method: RequestEnum.POST,
    data,
  });
};

export const updateEventActivity = (data: API.UpdateEventActivityParams) => {
  return request({
    url: eventActivityApi.eventActivityUpdate,
    method: RequestEnum.PUT,
    data,
  });
};

export const deleteEventActivity = (params: { id: number }) => {
  return request({
    url: eventActivityApi.eventActivityDelete,
    method: RequestEnum.DELETE,
    params,
  });
};

export const enabledActivity = (params: { id: number }) => {
  return request({
    url: eventActivityApi.activityEnabled,
    method: RequestEnum.POST,
    params,
  });
};
